#!/bin/bash

CPU=16
MEM=32
DISK=/export/openEuler-22.03.qcow2
ISO=openEuler-22.03-LTS-aarch64-dvd.iso

args=(
-M virt
-smp ${CPU}
-m ${MEM}G
-cpu host
-bios edk2-aarch64-code.fd
-enable-kvm
-drive file=${DISK},if=none,id=disk0,format=qcow2
-device virtio-blk-pci,drive=disk0,scsi=off,bootindex=1
-device e1000e,netdev=net0
-netdev user,id=net0
-drive file=${ISO},id=cdrom,if=none,media=cdrom
-device virtio-scsi-device -device scsi-cd,drive=cdrom
-vnc :1
)

args_run=(
-smp ${CPU}
-m ${MEM}G
-enable-kvm
-drive file=${DISK},if=none,id=disk0,format=qcow2
-device virtio-blk-pci,drive=disk0,scsi=off,bootindex=1
-netdev user,id=net0,hostfwd=tcp:127.0.0.1:5567-:22
-device virtio-net-pci,netdev=net0
-vga vmware
-vnc :1
)


#qemu-system-x86_64 ${args_run[@]} $@
qemu-system-aarch64 ${args[@]} $@

